Tomorrow Happy Karwa Chauth from Isolated Study! Study smarter this festive season with IsolatedAI.Try AI free →

Computer science

Computer science

'

For this assignment, you’ll modify a class that stores a list of inventory items so it uses an indexer, a delegate, an event, and operators. Then, you’ll modify the code for the Inventory Maintenance form so it uses these features. (C#)

1. Open the InventoryMaintenance project. This is an enhanced version of the Inventory Maintenance application from module six that uses a list class.

2. Review the code for the InvItemList class so you understand how it works. Then, review the code for the Inventory Maintenance form to see how it uses this class. Finally, run the application to see how it works.

Add an index to the InvItemList class

3. Delete the GetItemByIndex method from the InvItemList class, and replace it with an indexer that receives an int value. This indexer should include both get and set accessors, and the get accessor should check that the value that’s passed to it is a valid index. If the index isn’t valid, the accessor should throw an ArgumentOutOfRangeException with a message that consists of the index value.

4. Modify the Invoice Maintenance form to use this indexer instead of the GetItemByIndex method. Then, test the application to be sure it still works.

Add overloaded operators to the InvItemList class

5. Add overloaded + and - operators to the InvItemList class that add and remove an inventory item from the inventory item list.

6. Modify the Inventory Maintenance form to use these operators instead of the Add and Remove methods. Then, test the application to be sure it still works.

Add a delegate and an event to the InvItemList class

7. Add a delegate named ChangeHandler to the InvItemList class. This delegate should specify a method with a void return type and an InvItemList parameter.

8. Add an event named Changed to the InvItemList class. This event should use the ChangeHandler delegate and should be raised any time the inventory item list changes.

9. Modify the Inventory Maintenance form to use the Changed event to save the inventory items and refresh the list box any time the list changes. To do that, you’ll need to code an event handler that has the signature specified by the delegate, you’ll need to wire the event to the event handler, and you’ll need to remove any unnecessary code from the event handlers for the Save and Delete buttons. When you’re done, test the application to be sure it still works.

The majority of changes will be within the InvItemList.cs code.

The code is as follows:

Inventory Maintenance form

V4PKx Ke Kth HLE0AAAAASUVORK5CYII=



InvItemList.cs

Isolated Study


Program.cs

Dr YPuu3mzy YAAAAASUVORK5CYII=



Validator.cs

JCMBe4ly YOAOwlzi Xlt71n Ud YLnc Aw Hf Eu TAr Zw D2Euf Cx Bm Avc S5MHEGYC9x Lu Y+89n NZg B2Emc ACKai OJv ABc A5VBTny QQu AE6hrjh PHrg Co H3i DADBVBdn E7g Aa F11cb Zy Bq B14gw Aw Ygz AARTUZx N4ALg HCq KMw Ccw0uc Te ACg Aje V87Xyz T0F4EGg AOt Lmt74Ao Aji XOABDMKs5p Alffm8AFAEd Zxdn KGQCOJc4AEIw4A0Aw L3H+n S59bw IXABxst XIGAI4lzg AQj Dg DQDDi DADBi DMABCPOABCMOANAMOIMAMGIMw AEI84AEMwf25j028s9Wq AAAAAASUVORK5CYII=

'

Manu
Manu

Expert Title:TEST

Answer

Student’s rating for this solution:

★ ★ ★ ★ ★ (5/5)

Extracted Transcript from Images

+